import requests
url = 'http://www.baidu.com'
response = requests.get(url)
# response 类型
print(type(response))
#设置编码集
response.encoding='utf-8'
# 获取网页源码
# print(response.text)
# 获取url地址
print(response.url)
#获取二进制数据
# print(response.content)
# 获取响应状态
print(response.status_code)
#获取响应头
print(response.headers)